package com.hbnu.aspect;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;

//@component  //此注解表明当前类为切面类
@Aspect
public class LogRecord {
    @Before("execution(* com.hbnu.service.CurtService.*(..))")
    public void beforeAddCart() {
        System.out.println("前置通知：");
    }

    @After("execution(* com.hbnu.service.CurtService.*(..))")
    public void aroundAddCart() {
        System.out.println("环绕通知");
        System.out.println("环绕通知，在被增强方法之后执行");
//        proceedingJoinPoint.proceed();
        System.out.println("环绕通知，在被增强方法之钱执行");
    }
}
